// noinspection JSAnnotator
import Vue from 'vue'
// noinspection JSAnnotator
import Router from 'vue-router'
// noinspection JSAnnotator
import Home from "../components/Home"
import Login from "../components/Login"
import Register from "../components/Register"
import Course from "../components/Course"
import Detail from "../components/Detail"
import Cart from "../components/Cart"
import Order from "../components/Order"
import Success from "../components/Success"
import UserOrder from "../components/UserOrder"
import Player from "../components/Player"

Vue.use(Router);

// noinspection JSAnnotator
export default new Router({
  mode: 'history', // 去掉路由中的 #
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
    },
    {
      path: '/user/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/user/register',
      name: 'Register',
      component: Register,
    },
    {
      path: '/course/category',
      name: 'Course',
      component: Course,
    },
    {
      path: '/course/detail/:id',
      name: 'Detail',
      component: Detail,
    },
    {
      path: '/cart',
      name: 'Cart',
      component: Cart,
    },
    {
      path: '/order',
      name: 'Order',
      component: Order,
    },
    {
      path: '/payment/result',
      name: 'Success',
      component: Success,
    },
    {
      path: '/user/order',
      name: 'UserOrder',
      component: UserOrder,
    },
    {
      path: '/course/player', // vid 先写死
      name: 'Player',
      component: Player,
    }
  ]
})
